﻿using System;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.Validation.Localization;
using Volo.Abp.VirtualFileSystem;

namespace Sample.Novel.Localization
{
    [DependsOn(
        typeof(AbpLocalizationModule)
        )]
    public class NovelLocalizationModule
        :AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            Configure<AbpVirtualFileSystemOptions>(options =>
            {
                options.FileSets.AddEmbedded<NovelLocalizationModule>("Sample");
            });

            Configure<AbpLocalizationOptions>(options =>
            {
                options.Resources
                    .Add<TestResource>("en")
                    .AddBaseTypes(typeof(AbpValidationResource))
                    .AddVirtualJson("/Localization");

                options.DefaultResourceType = typeof(TestResource);
            });

/*            Configure<AbpExceptionLocalizationOptions>(options =>
            {
                options.MapCodeNamespace("Test", typeof(TestResource));
            });*/
        }
    }
}
